// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 物料成本卷积状态类型枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2023-05-16
 */
public enum ConvolutionStatusTypeEnum {
    CHECK_FAILED(1, "不满足卷积条件"),
    CONVOLUTION_PROGRESSING(2, "卷积进行中"),
    CONVOLUTION_FINISHED(3, "卷积完成"),
    COST_VERIFIED(4, "成本已核对"),
    STATUS_CHANGING(5, "状态修改中"),
    STATUS_FAILED(6, "状态修改失败"),
    STATUS_FINISHED(7, "状态修改完成"),
    CONVOLUTION_ABOLISH(8, "废止");

    private int value;

    private String name;

    ConvolutionStatusTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        ConvolutionStatusTypeEnum arrObj[] = ConvolutionStatusTypeEnum.values();
        for (ConvolutionStatusTypeEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return "未知状态";
    }
}
